package tråde;

//dårlig løsning. Bedre med implement af runnable.

class ThreadDemo {
	public static void main(String[] args) throws InterruptedException {
		Thread a = new OutputThread('a');
		Thread b = new OutputThread('b');
		a.start(); 
		//Thread.sleep(1);
		b.start();
	}
}

class OutputThread extends Thread {
	private char c;
	OutputThread(char outputChar) {
		c = outputChar;
	}
	public void run() {
		for (int i=0; i<100; i++) {
			System.out.print(c); System.out.flush();
		}
	}
}